package main

import (
	"bytes"
	"fmt"
	"net"
)

func main() {

	conn, err := net.Dial("tcp", "127.0.0.1:8080")

	errHandler(err)

	var writeStr string




	for i := 0; i < 10000; i++ {

		fmt.Scan(&writeStr)

		bufferStrin := bytes.NewBufferString(writeStr)

		n, err := conn.Write(bufferStrin.Bytes())


		errHandler(err)

		fmt.Println("发送数据完成,发送长度: ", n)
	}
}

func errHandler(err error) {

	if err != nil {

		fmt.Println(err)

	}
}
